package com.aikg.kgrag_java.utils;

/**
 * @ClassName: Constants
 * @Description: 枚举信息定义
 * @Author: LZX
 * @Date: 2023/9/13 19:49
 */
public class Constants {


    public enum ResponseCode {
        /**
         * 成功
         */
        // 登录段1~50
        NEED_LOGIN(1, "需要登录后操作"),
        LOGIN_PASSWORD_ERROR(2, "密码错误"),
        // TOKEN50~100
        TOKEN_INVALID(50, "无效的TOKEN"),
        TOKEN_EXPIRE(51, "TOKEN已过期"),
        TOKEN_REQUIRE(52, "TOKEN是必须的"),
        // SIGN验签 100~120
        SIGN_INVALID(100, "无效的SIGN"),
        SIG_TIMEOUT(101, "SIGN已过期"),
        //成功200
        SUCCESS(200, "成功"),

        // 参数错误 500~1000
        PARAM_REQUIRE(500, "缺少参数"),
        PARAM_INVALID(501, "无效参数"),
        PARAM_IMAGE_FORMAT_ERROR(502, "图片格式有误"),
        SERVER_ERROR(503, "服务器内部错误"),

        // 数据错误 1000~2000
        DATA_EXIST(1000, "数据已经存在"),
        UN_ERROR(1001, "未知失败"),
        ILLEGAL_PARAMETER(1002, "非法参数"),
        PARAM_IS_BLANK(1003, "参数为空"),
        INDEX_DUP(1004, "主键冲突"),
        NO_UPDATE(1005, "SQL操作无更新"),
        DATA_NOT_EXIST(1006, "数据不存在"),
        USER_NOT_LOGGED_IN(2001, "用户未登录"),
        USER_PASSWORD_ERROR(2002, "密码错误"),
        USER_NOT_EXIST(2003, "用户不存在"),

        // 数据错误 3000~3500
        NO_OPERATOR_AUTH(3000, "无权限操作"),
        INSERT_FAIL(3001, "添加失败"),
        DELETE_FAIL(3002, "删除失败"),
        UPDATE_FAIL(3003, "更新失败"),
        QUERY_FAIL(3004, "查询为空"),
        DELETE_HAVE_NODE_FAIL(3005, "删除失败,节点有实体连接"),
        DELETE_HAVE_REL_FAIL(3006, "删除失败,该关系有实体继承"),
        NEED_ADMIND(3007, "需要管理员权限");


        private final Integer code;
        private final String info;

        ResponseCode(Integer code, String info) {
            this.code = code;
            this.info = info;
        }

        public Integer getCode() {
            return code;
        }

        public String getInfo() {
            return info;
        }

    }

    public enum RelationName {

        // 继承关系
        EXTEND("HAS_EXTEND"),

        // 属性关系
        PROPERTY("HAS_PROPERTY"),

        // 本体连接关系
        O_CONNECT("HAS_O_CONNECT");

        private final String namespace;

        RelationName(String namespace) {
            this.namespace = namespace;
        }

        public String getNamespace() {
            return namespace;
        }
    }

    public enum AttributeName {

        // 判断是否进入项目的Session
        PROJECT_ATT("per_project");

        private final String name;

        AttributeName(String namespace) {
            this.name = namespace;
        }

        public String getNamespace() {
            return name;
        }

    }

    //删除标志
    public final static byte Delete = -1;
    public final static byte UnDelete = 0;


    //分页标志
    public final static int CURRENTPAGE = 1;
    public final static int SIZE = 10;

    //用户角色标志
    public final static int MANAGER = 1; //管理员
    public final static int USER = 0;  //普通用户


}
